-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Do not display unqualified assoc item completions #8123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@Veykril , could you have a look? There are ways to return the existing bits of "qualify the assoc item" functionality if you're interested in it now, but it'll work for the current crate's items only. |
|
Hmm, we don't necessarily need to get rid of all associated item completions. Regarding the issue in the Zulip thread, IMO it'd also be fine to complete |
|
But That was my reasoning for excluding such cases at least: we cannot guess which impl to use without the user helping us and having just the trait is not enough. We could instead propose the corresponding structs and their assoc items, but that's unavailable for a number of reasons, ergo also excluded and the test ignored. |
|
I personally don't see too much of a problem in not seeing associated items I think, at least for now? I don't think I can tell until I'm missing it though 😄 It would certainly be nice to at least have it for non-trait impls but if I saw that right reading the comment that will take quite a bit of work to be doable efficiently. |
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=71fd67cdf4b5d7520420af4475a71824 🙂 |
|
I'm actually following some of the pedantic clippy rules and always write I'm also not sure we should have this kinds of completions, not right away at least: it feels like I have to write way more code and tests to properly support such cases, so let's prohibit them for a while and iterate on top. bors r+ |
|
changelog fix |
Part of https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/autoimport.20weirdness
Removes all flyimport completions for any unqualified associated type, effectively reverting #8095
I've explained the reasoning in the corresponding FIXME and open to discussions.
As an alternative way, we could add yet another parameter in the method that's used by the
qualify_pathand enable it for the qualify assists only.